package com.stu.spring04.service.impl;

import com.stu.spring04.annotation.Log;
import com.stu.spring04.entity.User;
import com.stu.spring04.mapper.IUserMapper;
import com.stu.spring04.service.IUSerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: UserServiceImpl
 * Package: com.stu.spring04.service.impl
 * Description: @Version 1.0
 */

@Service
public class UserServiceImpl implements IUSerService {
    @Autowired
    private IUserMapper userMapper;

    @Override
    @Log
    public Integer addUser(User user) {
        Integer integer = userMapper.addUser(user);
        return integer;
    }

    @Override
    public List<User> selectUser() {
        List<User> userList = userMapper.selectUser();
        return userList;
    }

    @Override
    public User selectUserById(int id) {
        User user = userMapper.selectUserById(id);
        return user;
    }
}
